<template>
  <div>
    <form @submit.prevent>
        <input type="text" name="username" v-model.trim.lazy="form.username">

        <input type="text" name="password" v-model.trim.number="form.password">

        <button @click="fn">提交</button>
    </form>
  </div>
</template>

<script>
export default {
  data(){
    return {
      form:{
        username:"",
        password:"",
      }
    }
  },
  methods:{
    fn(){
      console.log(this.form.username);
      console.log(this.form.password);
    }
  }
}
</script>

<style lang="less">

</style>